/**
 * Copyright &copy; 2012-2014 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.inventory.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.thinkgem.jeesite.common.persistence.DataEntity;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * 连接Entity
 * @author johnKee
 * @version 2016-08-30
 */
public class HostLinks extends DataEntity<HostLinks> {
	
	private static final long serialVersionUID = 1L;
	private String fromHostid;		// from主机id
	private String fromHostname;		// from主机名称
	private String fromHostalias;		// from主机别名
	private String fromHostType;        // from主机类型
	private String fromHostlinkid;		// from主机连接标识
	private String fromHostlinkattr;		// from主机连接属性 : IP，端口等
	private String toHostid;		// to主机id
	private String toHostname;		// to主机名称
	private String toHostalias;		// to主机别名
	private String toHostType;      // to主机类型
	private String toHostlinkid;		// to主机连接标识
	private String toHostlinkattr;		// to主机连接属性
	private String linkAttr;		// 连接属性
	private Date fromTime;		// 开始时间
	private Date thruTime;		// 结束时间
	
	public HostLinks() {
		super();
	}

	public HostLinks(String id){
		super(id);
	}

	@Length(min=1, max=64, message="from主机id长度必须介于 1 和 64 之间")
	public String getFromHostid() {
		return fromHostid;
	}

	public void setFromHostid(String fromHostid) {
		this.fromHostid = fromHostid;
	}
	
	@Length(min=0, max=100, message="from主机名称长度必须介于 0 和 100 之间")
	public String getFromHostname() {
		return fromHostname;
	}

	public void setFromHostname(String fromHostname) {
		this.fromHostname = fromHostname;
	}
	
	@Length(min=0, max=128, message="from主机别名长度必须介于 0 和 128 之间")
	public String getFromHostalias() {
		return fromHostalias;
	}

	public void setFromHostalias(String fromHostalias) {
		this.fromHostalias = fromHostalias;
	}

	public String getFromHostType() {
		return fromHostType;
	}

	public void setFromHostType(String fromHostType) {
		this.fromHostType = fromHostType;
	}

	@Length(min=0, max=64, message="from主机连接标识长度必须介于 0 和 64 之间")
	public String getFromHostlinkid() {
		return fromHostlinkid;
	}

	public void setFromHostlinkid(String fromHostlinkid) {
		this.fromHostlinkid = fromHostlinkid;
	}
	
	@Length(min=0, max=64, message="from主机连接属性 : IP，端口等长度必须介于 0 和 64 之间")
	public String getFromHostlinkattr() {
		return fromHostlinkattr;
	}

	public void setFromHostlinkattr(String fromHostlinkattr) {
		this.fromHostlinkattr = fromHostlinkattr;
	}
	
	@Length(min=1, max=64, message="to主机id长度必须介于 1 和 64 之间")
	public String getToHostid() {
		return toHostid;
	}

	public void setToHostid(String toHostid) {
		this.toHostid = toHostid;
	}
	
	@Length(min=0, max=100, message="to主机名称长度必须介于 0 和 100 之间")
	public String getToHostname() {
		return toHostname;
	}

	public void setToHostname(String toHostname) {
		this.toHostname = toHostname;
	}
	
	@Length(min=0, max=128, message="to主机别名长度必须介于 0 和 128 之间")
	public String getToHostalias() {
		return toHostalias;
	}

	public void setToHostalias(String toHostalias) {
		this.toHostalias = toHostalias;
	}

	public String getToHostType() {
		return toHostType;
	}

	public void setToHostType(String toHostType) {
		this.toHostType = toHostType;
	}

	@Length(min=0, max=64, message="to主机连接标识长度必须介于 0 和 64 之间")
	public String getToHostlinkid() {
		return toHostlinkid;
	}

	public void setToHostlinkid(String toHostlinkid) {
		this.toHostlinkid = toHostlinkid;
	}
	
	@Length(min=0, max=64, message="to主机连接属性长度必须介于 0 和 64 之间")
	public String getToHostlinkattr() {
		return toHostlinkattr;
	}

	public void setToHostlinkattr(String toHostlinkattr) {
		this.toHostlinkattr = toHostlinkattr;
	}
	
	@Length(min=0, max=256, message="连接属性长度必须介于 0 和 256 之间")
	public String getLinkAttr() {
		return linkAttr;
	}

	public void setLinkAttr(String linkAttr) {
		this.linkAttr = linkAttr;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@NotNull(message="开始时间不能为空")
	public Date getFromTime() {
		return fromTime;
	}

	public void setFromTime(Date fromTime) {
		this.fromTime = fromTime;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getThruTime() {
		return thruTime;
	}

	public void setThruTime(Date thruTime) {
		this.thruTime = thruTime;
	}
	
}